/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package servidor;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.Date;

/**
 *
 * @author CUC103AF08
 */
public class Log {
    @SuppressWarnings("IncompatibleEquals")
    public void guardarMensaje(String mensaje){
        java.util.Date fecha = new Date();
        System.out.println (fecha.getDay());
        System.out.println (fecha.getMonth());
        try {
            
            FileWriter fw = new FileWriter("log.txt", true);
            BufferedWriter bw = new BufferedWriter(fw);
            PrintWriter salida = new PrintWriter(bw);
            String m =fecha+" "+mensaje;
            salida.println(m);
            salida.close();
}
catch(java.io.IOException ioex) {
   System.out.println("se presento el error: "+ioex.toString());


}}

}
